package com.yuanfeng.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yuanfeng.business.dto.GdbMerchantClassBindDTO;
import com.yuanfeng.business.dto.PersonMessageQueryDTO;
import com.yuanfeng.business.dto.ShopClassBindDTO;
import com.yuanfeng.business.entity.ShopClassBindEntity;
import com.yuanfeng.business.vo.ClassBindVO;
import com.yuanfeng.business.vo.ShopClassBindQueryVO;
import com.yuanfeng.business.vo.ShopClassBindVO;
import com.yuanfeng.commoms.vo.shop.ShopGoodsCatVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @ClassName ShopClassBindMapper
 * @Description
 * @Author cf
 * @Date 2023/6/20 16:46
 * @Version 1.0
 */
@Mapper
public interface ShopClassBindMapper extends BaseMapper<ShopClassBindEntity> {

    /**
     * 查询经营类目
     * @param param
     * @return
     */
    List<ShopClassBindQueryVO> selectByShopIdOrJoinId(@Param("param") PersonMessageQueryDTO param);

    /**
     * 查询总数
     * @param param
     * @return
     */
    Integer selectByShopIdOrJoinIdCount(@Param("param") PersonMessageQueryDTO param);

    /**
     * 获取商品分类id
     * @param commonId
     * @return
     */
    String queryGoodsCatId(@Param("commonId")String commonId);

    /**
     * 查询店铺经营类目
     * @param catId
     * @param shopId
     * @return
     */
    Integer verifyBusinessCategory(@Param("catId") String catId, @Param("shopId") String shopId);


    /**
     * 分页查询店铺绑定集合
     *
     * @param page
     * @param param
     * @return
     */
    IPage<ShopClassBindVO> selectShopClassBindList(IPage<ShopClassBindVO> page, @Param("param") ShopClassBindDTO param);

    /**
     *
     * @param currentCat
     * @return
     */
    Integer insertOrUpdateSelective1(@Param("currentCats") List<GdbMerchantClassBindDTO>  currentCat);


    /**新增店铺经营类目
     *
     * @param currentCat
     */
    Integer insertOrUpdateSelective(@Param("currentCat") ShopClassBindDTO currentCat);

    /**
     * 查询店铺
     *
     * @param param
     * @return
     */
    List<ClassBindVO> selectByShopIdOrJoinIdList(@Param("param") Map<String, Object> param);


    /**
     * 查询所有分类
     * @return
     */
    List<ShopGoodsCatVO> selectAllCat3();

    /**
     * 查找店铺是否是自营店铺
     * @param shopId
     * @return
     */
    Boolean queryShopSelfSupport(String shopId);
}
